﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq.Mapping;
using System.Data.Linq;

namespace MRSite.Entity
{
    //服务网点绑定表
    [Table(Name = "service_bind")]
    public class ServiceBind : Entity
    {
        /// <summary>
        ///
        /// </summary>
        [Column(Name = "id", IsPrimaryKey = true, CanBeNull = false, IsVersion = true)]
        public override int id { get; set; }

      

        /// <summary>
        /// 用户id
        /// </summary>
        [Column(Name = "user_id")]
        public int user_id { get; set; }

        /// <summary>
        /// 用户名
        /// </summary>
        [Column(Name = "user_name")]
        public String user_name { get; set; }

        /// <summary>
        /// 绑定的服务网点id
        /// </summary>
        [Column(Name = "service_id")]
        public int service_id { get; set; }

         /// <summary>
        /// 服务网点用户id
        /// </summary>
        [Column(Name = "service_userid")]
        public int service_userid { get; set; }

        /// <summary>
        /// 服务网点用户名
        /// </summary>
        [Column(Name = "service_username")]
        public String service_username { get; set; }
        
        /// <summary>
        /// 绑定时间
        /// </summary>
        [Column(Name = "addtime")]
        public DateTime addtime { get; set; }

        

        /// <summary>
        /// 解绑时间
        /// </summary>
        [Column(Name = "canceltime")]
        public DateTime? canceltime { get; set; }

        /// <summary>
        /// 状态 1绑定；0：解绑
        /// </summary>
        [Column(Name = "status")]
        public int status { get; set; }

        private EntityRef<Customer> _member;

        /// <summary>
        /// 
        /// </summary>
        [Association(Storage = "_member", ThisKey = "user_id", OtherKey = "id")]
        public Customer CustomerItem
        {
            get { return this._member.Entity; }
            set { this._member.Entity = value; }
        }

    }
}
